package com.calenda.setevent.entity;

import org.json.JSONObject;

public class CalendarEntity {
	// "eventid": "1416639871052",
	// "eventname": "Giảm giá cuối năm",
	// "starttime":"12:05-05/01/2015",
	// "endtime":"12:05-06/01/2015",
	// "eventdescription": "Tĩnh Hiên Trà giảm giá một cốc trà còn 15K",
	// "location": "Tĩnh Hiên Trà quán",
	// "createuser": "anhdd",
	// "groupid": "201410001",
	// "groupname": "Tĩnh Hiên Trà"

	private String eventid;
	private String eventname;
	private String starttime;
	private String endtime;
	private String eventdescription;
	private String location;
	private String createuser;
	private String groupid;
	private String groupname;
	private JSONObject jsonObject;

	public CalendarEntity(JSONObject jsonObject) {
		this.jsonObject = jsonObject;

		this.eventid = jsonObject.optString("eventid", "");
		this.eventname = jsonObject.optString("eventname", "");
		this.starttime = jsonObject.optString("starttime", "");
		this.endtime = jsonObject.optString("endtime", "");
		this.eventdescription = jsonObject.optString("eventdescription", "");
		this.location = jsonObject.optString("location", "");
		this.createuser = jsonObject.optString("createuser", "");
		this.groupid = jsonObject.optString("groupid", "");
		this.groupname = jsonObject.optString("groupname", "");
	}

	public CalendarEntity(String eventid, String eventname, String starttime,
			String endtime, String eventdescription, String location,
			String createuser, String groupid, String groupname) {
		this.eventid = eventid;
		this.eventname = eventname;
		this.starttime = starttime;
		this.endtime = endtime;
		this.eventdescription = eventdescription;
		this.location = location;
		this.createuser = createuser;
		this.groupid = groupid;
		this.groupname = groupname;
	}

	public String getEventid() {
		return eventid;
	}

	public void setEventid(String eventid) {
		this.eventid = eventid;
	}

	public String getEventname() {
		return eventname;
	}

	public void setEventname(String eventname) {
		this.eventname = eventname;
	}

	public String getStarttime() {
		return starttime;
	}

	public void setStarttime(String starttime) {
		this.starttime = starttime;
	}

	public String getEndtime() {
		return endtime;
	}

	public void setEndtime(String endtime) {
		this.endtime = endtime;
	}

	public String getEventdescription() {
		return eventdescription;
	}

	public void setEventdescription(String eventdescription) {
		this.eventdescription = eventdescription;
	}

	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	public String getCreateuser() {
		return createuser;
	}

	public void setCreateuser(String createuser) {
		this.createuser = createuser;
	}

	public String getGroupid() {
		return groupid;
	}

	public void setGroupid(String groupid) {
		this.groupid = groupid;
	}

	public String getGroupname() {
		return groupname;
	}

	public void setGroupname(String groupname) {
		this.groupname = groupname;
	}

	public JSONObject toJson() {
		return this.jsonObject;
	}

	@Override
	public String toString() {
		return "CalendarEntity [eventid=" + eventid + ", eventname="
				+ eventname + ", starttime=" + starttime + ", endtime="
				+ endtime + ", eventdescription=" + eventdescription
				+ ", location=" + location + ", createuser=" + createuser
				+ ", groupid=" + groupid + ", groupname=" + groupname + "]";
	}

}
